using System;

namespace BarcodePrinting
{
	public static class CodeParseForEnum
	{
		public static int GetRotationCode(PrintingRotation eRotation)
		{
			int result;
			switch (eRotation)
			{
			case PrintingRotation.NoRotation:
				result = 1;
				break;
			case PrintingRotation.Rotation90:
				result = 2;
				break;
			case PrintingRotation.Rotation180:
				result = 3;
				break;
			case PrintingRotation.Rotation270:
				result = 4;
				break;
			default:
				result = 1;
				break;
			}
			return result;
		}

		private static int GetFontWeightCode(FontWeight fWwight)
		{
			int result;
			switch (fWwight)
			{
			case FontWeight.F标准_400:
				result = 400;
				break;
			case FontWeight.F非常细_100:
				result = 100;
				break;
			case FontWeight.F极细_200:
				result = 200;
				break;
			case FontWeight.F细_300:
				result = 300;
				break;
			case FontWeight.F中等_500:
				result = 500;
				break;
			case FontWeight.F半粗_600:
				result = 600;
				break;
			case FontWeight.F粗_700:
				result = 700;
				break;
			case FontWeight.F特粗_800:
				result = 800;
				break;
			case FontWeight.F黑体_900:
				result = 900;
				break;
			default:
				result = 400;
				break;
			}
			return result;
		}
	}
}
